1. Field of the Invention
The present invention relates generally to an improved data processing system and in particular a computer implemented method and apparatus for processing data. Still more particularly, the present invention relates to computer implemented method, apparatus, and computer usable program code for collecting and processing data during the execution of code with hardware assistance.
2. Description of the Related Art
In writing code, runtime analysis of the code is often performed as part of an optimization process. Runtime analysis is used to understand the behavior of components or modules within the code using data collected during the execution of the code. The analysis of the data collected may provide insight to various potential misbehaviors in the code. For example, an understanding of execution paths, code coverage, memory utilization, memory errors and memory leaks in native applications, performance bottlenecks, and threading problems are examples of aspects that may be identified through analyzing the code during execution.
The performance characteristics of code may be identified using a software performance analysis tool. The identification of the different characteristics may be based on a trace facility. A trace tool may use various techniques to provide information, such as execution flows as well as other aspects of an executing program. A trace may contain data about the execution of code. For example, a trace may contain trace records about events generated during the execution of the code. A trace also may include information, such as, a process identifier, a thread identifier, and a program counter. Information in the trace may vary depending on the particular profiling or analysis that is to be performed. A record is a unit of information relating to an event that is detected during the execution of the code.
Profiling is a process performed to extract regular and reoccurring operations or events present during the execution of code. Many different types of events may be profiled. For example, the time spent in a task or section of code, memory allocation, and most executed instructions. The results of profiling are used to optimize or increase the performance of software. Oftentimes, profiling may be used to tune or improve performance of a particular piece of software for a specific processor.
In a typical instrumented application, instrumentation code is executed as part of the application. Instrumentation code is a set of instructions used to obtain data about operations or events that occur during the execution of an application. One problem with instrumentation code is that this type of code invariably distorts the execution profile for the application. Instrumentation code competes for processor resources. These processor resources include, for example, the use of execution units, decoders, and registers. Further, the instrumentation code also competes for the use of memory and cache resources as well as input/output resources. Instrumentation code may introduce distortions in the execution profile. For example, memory and memory caches may be very heavily distorted by instrumentation code. Further, instrumentation code also can affect execution unit resources such as branch prediction logic, transfer look aside buffers (TLBs), instruction pipelines and instruction caches.